'''
Created on 2011-11-16

@author: Botao Wu
'''
import re

#num = int('it', 36)
#print num
#print hex(num)
#print bin(num)

def transfer(data):
    data = data.strip()
    lst = []
    if not data:
        return lst
    words = data.split(' ')
    for item in words:
        item = re.sub('\W', '', item)
        num = bin(int(item, 36))
        lst.append(str(num))
    return ' '.join(lst)

if __name__ == '__main__':
    print transfer('')
    
    